window.onload = function() {
	let images = document.getElementById("slide").getElementsByTagName("li"); // 获取id="slide"对象
	let len = images.length; // 获取图片的数量
	// console.info(len);
	let i = 0;
	
	let pointers = document.getElementById("pointer").getElementsByTagName("li");
	setInterval(function(){
		i = ++ i % len;
		
		for (let j = 0; j < len; ++ j) {
			if (i == j) {
				images[j].style.display = "block";
				pointers[j].className = "active";
			} else {
				images[j].style.display = "none";
				pointers[j].removeAttribute("class");
			}
		}
	}, 2000); // 每隔2秒钟执行函数一次
}